package com.wen.system.oauth;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.Map;
import java.util.Properties;

@Data
@Configuration
@ConfigurationProperties(prefix = "oauth")
//@PropertySource("classpath*:config.properties")
public class OAuthProperties {

    private GiteeProperties gitee;

    private AlipayProperties alipay;

    private Map<String, String> properties;

    public String getProperties(String type) {
        return properties.get(type);
    }

    private Properties asProperties(Map<String, String> source) {
        Properties properties = new Properties();
        properties.putAll(source);
        return properties;
    }
    @Data
    public static class GiteeProperties {
        private String clientId;

        private String clientSecret;

        private String redirectURI;

        private String authorizeURI;

        private String tokenURI;

        private String userInfoURI;


    }

    @Data
    public static class AlipayProperties{
        private String clientId;

        private String clientSecret;

        private String redirectURI;

        private String authorizeURI;

        private String tokenURI;

        private String userInfoURI;
    }
}